﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace Ebusiness_OrderService.Model
{
    [Table("T_OrderDetail")]
    public class OrderDetails : Entity<Guid>
    {
        public int OrderId { get; set; }

        public long ProductId { get; set; }

        [Required]
        [MaxLength(128)]
        public string ProductName { get; set; }

        public decimal UnitPrice { get; set; }
        public int Quantity { get; set; }

        public decimal TotalPrice => UnitPrice * Quantity;

        public decimal Discount { get; set; }
        public decimal FinalAmount => TotalPrice - Discount;

        public DateTime CreatedTime { get; set; } = DateTime.Now;
    }
}
